﻿

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>nextTick</title>

		<script src="../vue/dist/vue.js"></script>

    </head>
    <body class="docs">
	
	<br /><br />vue中nextTick和$nextTick的差别 - 仔仔爱学习 - 博客园<br /><br />
https://www.cnblogs.com/ch-zaizai/p/7883136.html<br /><br />
* `Vue.nextTick(callback)`，当数据发生变化，更新后执行回调。<br /><br />
* `Vue.$nextTick(callback)`，当dom发生变化，更新后执行的回调。<br /><br />
<ul id="demo">

    <li v-for="item in list">{{item}}</div>
</ul>

    </body>

<script type="text/javascript">
<!--
var demo = new Vue({
    el: '#demo',
    data: {
        list : [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    },
    methods: {
        push: function() {
			alert('push');
            this.list.push(11);
            this.nextTick(function() {
			debugger
                alert('数据已经更新')
            });
            this.$nextTick(function() {
                console.log('v-for渲染已经完成')
            })
        }
    }
})


</script>

</html>
